<?php
/**
 * Created by PhpStorm.
 * User: Jerry
 * Date: 2016/12/21
 * Time: 9:40
 */

namespace YMApi\Model;


use Think\Model;

/**
 * Class HomeTemplateStencilGoodsModel
 * @package SDXApi\Model
 */
class HomeTemplateStencilGoodsModel extends Model
{


	/**
	 * @var string
	 */
	protected $tableName = 'home_template_stencil_goods';


	/**
	 * Created by Jerry
	 * @param $stencil_id
	 * @return mixed
	 */
	public function find_template_stencil_goods_by_stencil_id($stencil_id)
	{
		$where = array(
			'stencil_id'	=>	$stencil_id,
		);

		$field = 'goods_id, sort, stencil_id';

		return $this->field($field)->where($where)->order('sort asc,id desc')->select();
	}
}